<include file="Common:minheader" />
<!-- /. NAV SIDE  -->
<form class="layui-form" action="">
    <input type="hidden" name="id" value="{$info.id}">
    <input type="hidden" value="{$valid_time}" id="valid_time">
	<div class="layui-form-item" id="cardNums">
		<label class="layui-form-label">卡次数</label>
		<div class="layui-input-block">
		  <input value="{$info.nums}" type="text" name="nums" required  lay-verify="required" placeholder="请输入卡次数" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">开始时间</label>
		<div class="layui-input-block">
			<input value="{$info.begin_time}" type="text" name="begin_time" placeholder="请选择上课开始时间" autocomplete="off" class="layui-input" id="addtime_fromdate1">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">结束时间</label>
		<div class="layui-input-block">
			<input value="{$info.end_time}" type="text" name="end_time" placeholder="请选择上课结束时间" autocomplete="off" class="layui-input" id="addtime_todate1">
		</div>
	</div>
	<div class="layui-form-item layui-form-text" style="z-index: 1;">
		<label class="layui-form-label">备注</label>
		<div class="layui-input-block">
			<textarea name="memo" placeholder="请输入备注" class="layui-textarea">{$info.memo}</textarea>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
		  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		  <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
  </div>
</form>
<script>
	//Demo
	layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function(data){
        	var cont = data.field;
        	$.ajax({
        		url:"{:U('Users/editUserCardNums')}",
        		type:'post',
        		dataType:'json',
        		data:cont,
        		success:function(data){
        			if(data.code==0){
        				layer.alert(data.message);
        			}else{
        				layer.alert(data.message, function(index){
        					//do something
        					window.parent.location.reload();
        					var index = parent.layer.getFrameIndex(window.name); 
        					parent.layer.close(index);
        				});
        			}
        		}
        	});
        	//layer.msg(JSON.stringify(data.field));
        	return false;
        });
	});
</script>
<!-- /. PAGE INNER  -->
<include file="Common:footer" />